package nkr1pt.popkorn.guice;

import nkr1pt.popkorn.extract.ExtractCommandsProvider;
import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import java.io.InputStream;
import nkr1pt.popkorn.download.Downloader;
import nkr1pt.popkorn.extract.ExtractCommandsMap;
import nkr1pt.popkorn.schedule.DownloadScheduler;
import nkr1pt.popkorn.schedule.GuiceJobFactory;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;

/**
 *
 * @author Kristof Vanhaeren
 */
public class PopkornModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(SchedulerFactory.class).to(StdSchedulerFactory.class).in(Scopes.SINGLETON);
        bind(GuiceJobFactory.class).in(Scopes.SINGLETON);
        bind(DownloadScheduler.class).in(Scopes.SINGLETON);
        bind(ExtractCommandsMap.class).toProvider(ExtractCommandsProvider.class);
        bind(InputStream.class).toInstance(System.in);
    }
}